import Request from "./request.js";
const API = {
	consumerOrderCreate: "/app/bus/order/consumer/platform/create",
	consumerList: "/app/bus/order/consumer/list",
	consumerAdvance: "/app/bus/order/consumer/advance",
	consumerRefund: "/app/bus/order/consumer/refund",
	consumerRefundCfg: "/app/bus/order/consumer/refund/cfg",
	consumerRefundState: "/app/bus/order/consumer/refund/state",
	consumerPayState: "/app/bus/order/consumer/pay/state",
	consumerOrderDetail: "/app/bus/order/consumer",
	consumerOrderCancel: "/app/bus/order/consumer/cancel",
	consumerOrderEvalutate: "/app/bus/order/consumer/evaluate",
	consumerOrderRemove: "/app/bus/order/consumer/remove",
	consumerOrderInvoice: "/app/bus/order/consumer/invoice",
	platformCreate: "/app/bus/order/consumer/platform/create",
	consumerAddress: "/app/bus/order/consumer/address",
	consumerService: "/app/bus/order/consumer/service",
	consumerUpdateService: "/app/bus/order/consumer/update/service",
	consumerEditCount:'/app/bus/order/consumer/edit/count',
	consumerScore:'	/app/bus/order/consumer/score'
};
// 立即下单
export const platformCreate = (params) =>
	Request.post(API.platformCreate, {}, {
		data: params
	});
// 设置地址
export const consumerAddress = (params) =>
	Request.post(API.consumerAddress, {}, {
		data: params
	});
// 设置服务时间
export const consumerService = (params) =>
	Request.post(API.consumerService, {}, {
		data: params
	});
// 创建订单
export const orderCreate = (params) =>
	Request.post(API.consumerOrderCreate, {}, {
		data: params
	});
// 查询订单列表
export const queryConsumerList = (params) =>
	Request.get(API.consumerList, {
		data: params
	});
// 支付
export const consumerAdvance = (params) =>
	Request.post(API.consumerAdvance, {}, {
		data: params
	});
// 查询支付订单状态
export const payState = (params) =>
	Request.get(`${API.consumerPayState}/${params}`);
// 申请退款
export const refund = (params) =>
	Request.put(API.consumerRefund, {}, {
		data: params
	});
// 退款原因
export const refundCfg = (params) => Request.get(`${API.consumerRefundCfg}`);
// 查询退款订单状态
export const refundState = (params) =>
	Request.get(`${API.consumerRefundState}/${params}`);
// 查询订单详情
export const orderDetail = (params) =>
	Request.get(`${API.consumerOrderDetail}/${params}`);
// 取消订单
export const orderCancel = (params) =>
	Request.put(API.consumerOrderCancel, {}, {
		data: params
	});
// 订单评价
export const orderEvalutate = (params) =>
	Request.post(API.consumerOrderEvalutate, {}, {
		data: params
	});
// 删除订单
export const orderRemove = (params) =>
	Request.delete(`${API.consumerOrderRemove}/${params}`);
// 订单开票
export const orderInvoice = (params) =>
	Request.post(API.consumerOrderInvoice, {}, {
		data: params
	});
// 变更服务
export const updateService = (params) =>
	Request.put(API.consumerUpdateService, {}, {
		data: params
	});
	
//编辑订单服务数量
export const editOrderCount = (params) =>
	Request.post(API.consumerEditCount, {}, {
		data: params
	});
	
// 订单详情评分
export const OrderDetailsScore = (params) =>
	Request.post(API.consumerScore, {}, {
		data: params
	});